package cn.sfrog.project.biz.admin.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;


public enum PayMethodEnum {
    /** 微信支付方式 **/
    WX_PAY("1","微信支付","wxPayService"),

    /** 支付宝支付方式 **/
    ALI_PAY("2","支付宝支付","aliPayService"),
    ;

    @EnumValue
    private final String value;

    private final String label;

    private final String payClass;

    /**
     *
     * @param value
     * @param label
     * @param payClass 支付方式的实现类 包地址
     */
    PayMethodEnum(String value, String label, String payClass) {
        this.value = value;
        this.label = label;
        this.payClass = payClass;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public String getPayClass() {
        return payClass;
    }

    public static PayMethodEnum getByValue( String value){
        if(value.equals(WX_PAY.getValue())){
            return WX_PAY;
        }else if(value.equals(ALI_PAY.getValue())){
            return ALI_PAY;
        }else{
            return null;
        }
    }
}
